<extend name="Public/base"/>

<block name="body">
    <form method="POST" id="form1" action="">
    <div class="main-title">
        <h2>员工分拣量统计</h2>
    </div>
    <div class="navbar navbar-default" style="margin: 0px;">

        <!-- 高级搜索 -->
        <div class="search-form " style="margin-top: 10px;margin-left: 10px;">
            <div class="sleft">
                日期：
                <input type="text" name="startDate" class="text input-large time" value="{$startTime}" placeholder="请选择统计日期"   style="height: 30px;width:120px" />
                到：
                <input type="text" name="endDate" class="text input-large time" value="{$endTime}" placeholder="请选择统计日期"   style="height: 30px;width:120px" />
            </div>
            <div class="sleft">
                <a class="sch-btn" href="javascript:;" id="search" url="{:U('staffstatistics')}"><i class="btn-search"></i></a>
            </div>
        </div>
    </div>

    <div class="data-table table-striped">
        <table>
            <thead>
            <tr>
                <th>工号</th>
                <th>姓名</th>
                <th>当前时间段累计分拣量</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <notempty name="_list">
                <volist name="_list" id="vo">
                    <tr>
                        <td>{$vo['jobnumber']} </td>
                        <td>{$vo['staffname']} </td>
                        <td>{$vo['missionCount']} </td>
                        <td> <a class="btn btn-default" href="{:U('Sort/staffdetail',array('staffname'=>$vo['staffname'],'startDate'=>$startTime,'endDate'=>$endTime))}">明细</a></td>
                    </tr>
                </volist>
                <else/>
                <td colspan="4" class="text-center"> aOh! 暂时还没有内容! </td>
            </notempty>
            </tbody>
        </table>
    </div>
    <div class="page">
        {$_page}
    </div>
    </form>
</block>

<block name="script">
    <script type="text/javascript">

        $(function () {
            $('.time').datetimepicker({
                format: 'Y-m-d',
                language: "zh-CN",
                minView: 2,
                autoclose: true
            });
        });

        $("#search").click(function () {
            var url = $(this).attr('url');

            var query = $('.search-form').find('input').serialize();
            var queryselect = $('.search-form').find('select').serialize();

            query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
            query = query.replace(/^&/g, '');
            queryselect = queryselect.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
            queryselect = queryselect.replace(/^&/g, '');

            if (url.indexOf('?') > 0) {
                url += '&' + query;
                url += '&' + queryselect;
            } else {
                url += '?' + query;
                url += '?' + queryselect;
            }

            window.location.href = url;
        });
        //回车搜索
        $(".search-input").keyup(function (e) {
            if (e.keyCode === 13) {
                $("#search").click();
                return false;
            }
        });
        highlight_subnav('{:U('Sort/staffstatistics')}');
    </script>
</block>